const Router = require('koa-router')
const {userAuthentication,
        userValidator,
        cryptPassword,
        verifylogin} = require('../middleware/user.middleware')

const {register,
        login} = require('../controller/user.controller');

const router = new Router({prefix:'/users'})

// 注册接口
router.post('/register',userValidator,userAuthentication,cryptPassword,register)

// 登录接口
router.post('/login',userValidator,verifylogin,login)

module.exports = router;
